docs(rfd): Agent Authentication State Query#658
Open
xtmq wants to merge 5 commits intoagentclientprotocol:mainfrom
Open
docs(rfd): Agent Authentication State Query#658xtmq wants to merge 5 commits intoagentclientprotocol:mainfrom
xtmq wants to merge 5 commits intoagentclientprotocol:mainfrom
Conversation
anna239
reviewed
Mar 6, 2026
benbrandt
reviewed
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
title: "Agent Authentication State Query"
Elevator pitch
Add an
auth/statusmethod and corresponding capability that allows clients to query the agent's current authentication state. This lets clients determine whether the agent is already configured with valid credentials or requires authorization before creating a session, without relying on the ambiguous error behavior ofsession/new.Status quo
Currently, there is no dedicated way for a client to determine whether an agent has valid authentication configured. The typical workaround is:
initializesession/newThis approach has significant problems:
session/newmethod is not required by the specification to check authorization. Some agents validate credentials eagerly, others do so lazily (e.g., on the first LLM call). The client cannot rely onsession/newto consistently surface auth issues.Shiny future
Clients will be able to:
setLlmEndpoints)Implementation details and plan
Intended flow
The client calls
initialize, inspects capabilities to confirmauth/statussupport, then queries auth state before deciding how to proceed.sequenceDiagram participant Client participant Agent Client->>Agent: initialize Note right of Agent: Agent reports capabilities,<br/>including auth/status support Agent-->>Client: initialize response<br/>(agentCapabilities.auth.status) Client->>Agent: auth/status Agent-->>Client: auth/status response<br/>(authenticated, message) alt Authenticated Client->>Agent: session/new else Not authenticated Note over Client: Client initiates<br/>authorization flow<br/>(e.g., call authenticate, setLlmEndpoints) Client->>Agent: authenticate Client->>Agent: session/new endinitialize. The agent responds with capabilities, includingauth/statussupport viaagentCapabilities.auth.auth/status. The agent inspects its local configuration, stored credentials, or environment to determine the current auth state.Capability advertisement
The agent advertises support for the
auth/statusmethod via the existingauthcapability inagentCapabilities:Initialize Response example:
{ "jsonrpc": "2.0", "id": 0, "result": { "protocolVersion": 1, "agentInfo": { "name": "MyAgent", "version": "2.0.0" }, "agentCapabilities": { "auth": { "status": true }, "sessionCapabilities": {} } } }auth/statusmethodA method that can be called after initialization to query the agent's current authentication state.
JSON Schema Additions
{ "$defs": { "AuthStatusResponse": { "description": "Response to auth/status method.", "properties": { "authenticated": { "type": "boolean", "description": "Whether the agent has credentials configured." }, "message": { "type": ["string", "null"], "description": "Human-readable description of the overall auth state." }, "_meta": { "additionalProperties": true, "type": ["object", "null"] } }, "required": ["authenticated"], "type": "object" } } }Example Exchange
auth/status Request:
{ "jsonrpc": "2.0", "id": 1, "method": "auth/status", "params": {} }auth/status Response (authenticated):
{ "jsonrpc": "2.0", "id": 1, "result": { "authenticated": true, "message": "Credentials are configured" } }auth/status Response (unauthenticated):
{ "jsonrpc": "2.0", "id": 1, "result": { "authenticated": false, "message": "No credentials configured. Please provide API keys or configure an LLM endpoint." } }Behavior
Capability advertisement: The agent SHOULD include
auth.statusinagentCapabilitiesif it supports theauth/statusmethod. Clients MUST check for this capability before calling the method.Timing: The
auth/statusmethod MUST be callable afterinitialize. It MAY be called multiple times (e.g., afterauthenticate, to re-check state).Local checks only: The agent MAY determine auth state based on locally available information (config files, environment variables, stored tokens) or by making external API calls.
authenticated: truemeans credentials are present, NOT that they are guaranteed to be valid.No side effects: Calling
auth/statusMUST NOT modify any agent state. It is a pure query.Aggregate response: The response includes only top-level
authenticatedand optionalmessage, keeping the API surface minimal and avoiding per-method complexity.Frequently asked questions
Why not rely on
session/newerrors?The
session/newmethod is designed for session creation, not for auth validation. Per the specification, agents are not required to validate credentials during session creation — some agents defer validation to the first actual LLM call. This means a successfulsession/newdoes not guarantee the agent is authenticated, and a failedsession/newmay fail for reasons unrelated to authentication. A dedicated method provides a clear, unambiguous signal.Why not include auth state in the
initializeresponse directly?The
initializeresponse contains capabilities — what the agent supports. Auth state is runtime information — what the agent currently has configured. Mixing these concerns would makeinitializeless predictable. Additionally, auth state may change after initialization (e.g., after asetLlmEndpointscall), and a separate method allows re-querying.Why not just check for the presence of environment variables on the client side?
Agents may obtain credentials from many sources: config files, keychains, OAuth tokens, environment variables, or even embedded keys. The client has no visibility into these mechanisms. Only the agent knows whether it has usable credentials configured.
Why did we remove additional auth details from
auth/statusfor now?Extra fields (such as per-auth-method state or "which auth method was used") are not consistently well-defined across agents. In practice, one auth flow can enable multiple credential types (for example, terminal login resulting in an API key), so a strict 1:1 mapping can be ambiguous and potentially misleading for clients.
To avoid locking in confusing semantics, the proposal currently keeps
auth/statusminimal and reliable: top-levelauthenticatedplus optionalmessage. This solves the immediate UX and control-flow problem while preserving room to add richer, standardized details later once cross-agent semantics are clearer.Revision history
authMethodsfrom the proposal and keep aggregate auth state only (authenticated+ optionalmessage)getAuthStatetoauth/status, nest capability underagentCapabilities.auth